# 功能:接收用户输入的字符串,将设定敏感词(如:盗版,傻子)替换为*
sensitive = input("请输入敏感词:")
sentence = input("请输入一句话:")
for item in sensitive:  # 遍历输入的每个字符
    if item in sentence:  # 如果敏感词在输入的字符串中将替换为*
        sentence = sentence.replace(item, '*')  # 将替换过的字符串重新赋给sentence
print(sentence)
